package com.xy.etl.ibatis.node.impl;

import com.xy.etl.ibatis.node.XySQLSuperNode;

import java.util.HashMap;
import java.util.Map;

public class XySQLModelItemNode extends XySQLSuperNode {

    public static final String ATT_NAME = "name";

    public static final String ATT_TYPE = "type";

    public static final String ATT_FORMAT = "format";

    @Override
    public String getTag() {
        return "item";
    }

    @Override
    public XySQLSuperNode clone() {
        return new XySQLModelItemNode();
    }

    /**
     * 参数
     *
     * @return
     */
    public Map<String, Map<String, String>> getItemMap() {
        Map<String, Map<String, String>> resMap = new HashMap<>();

        String name = this.getPropertyMap().get(ATT_NAME);
        if (name == null || name.trim().length() <= 0) {
            return resMap;
        }
        resMap.put(name, this.getPropertyMap());
        return resMap;
    }

}
